System Administration
176
Getting Started Guide
Re-Compiling the Linux Kernel
Because OpenLinux includes full source code for the operating system kernel,
you can recompile the kernel if the need arises. Reasons to do this include:
•
Adding patches or updates to the kernel
•
Adding additional hardware support
•
Enabling a core feature (such as IP firewalling) that was disabled by
default
Re-compiling the kernel isn’t as difficult as it sounds. Depending on your sys-
tem’s speed, re-compiling may take less than 10 minutes or several hours. (A
Pentium 200 MHz with 32 MB of RAM takes about 10 minutes for re-compil-
ing.)
You must have the kernel source code packages and supporting development
tools installed on your OpenLinux system before using this procedure.
To re-compile the Linux kernel:
1.
Log in as root
2.
Make a backup copy of the current kernel using a command like this
one:
cp /vmlinuz /vmlinuz.backup
CAUTION: Don’t name the backup kernel vmlinuz.old; that
name is already used internally by the kernel.
3.
If you don’t have a diskette to boot from in case of problems, add a
section to your /etc/lilo.conf file so that you can boot from the
vmlinuz.backup kernel that you created in the last step. (If you don’t
have a bootable diskette, you can create one using the dd command.)
4.
Run the /sbin/lilo program to update the lilo boot loader if you have
changed /etc/lilo.conf.
5.
Change to the /usr/src/linux directory.
cd /usr/src/linux
6.
Depending on which tool you want to use to reconfigure the kernel,
enter one of these commands:
•
make config to start a command-line interface that queries you (Yes/No)
for each kernel option. This is best for those who are already familiar with
the kernel compilation process.